package com.xueyi.aixihu.exception;

import com.xueyi.aixihu.status.SystemCode;
import org.springframework.util.StringUtils;

/**
 * @author LuQi
 * @类描述 深造异常类
 * @时间 2021/6/19
 */
public class SzException extends Exception {

    public int code;
    public Object o;




    public SzException(int code, String msg) {
        super(msg);
        this.code = code;
    }

    public SzException(int code, String msg , Object o) {
        super(msg);
        this.code = code;
        this.o = o;
    }

    public static void isNull(Object o, String message) throws SzException {

        if (StringUtils.isEmpty(o)) {
            throw new SzException(SystemCode.QUERY_CHECK_ERROR, message);
        }
    }
}
